import { http } from '@/utils/http'

export interface ILoginData {
  username: string
  password: string
}

export interface IRegisterData {
  username: string
  password: string
  phone: string
}

export const login = async (data: ILoginData): Promise<any> => {
  return await http.post('/api/auth/login', data)
}

export const register = async (data: IRegisterData): Promise<any> => {
  return await http.post('/api/user/register', data)
}

export const getUserInfo = async () => {
  return await http.get('/api/user/info')
}
